/*
 Navicat Premium Data Transfer

 Source Server         : @localhost
 Source Server Type    : MySQL
 Source Server Version : 50732
 Source Host           : localhost:3306
 Source Schema         : sx_exam

 Target Server Type    : MySQL
 Target Server Version : 50732
 File Encoding         : 65001

 Date: 08/12/2020 14:07:19
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for acl
-- ----------------------------
DROP TABLE IF EXISTS `acl`;
CREATE TABLE `acl` (
  `id` varchar(30) NOT NULL COMMENT '权限id',
  `path` varchar(100) NOT NULL DEFAULT '' COMMENT '权限路径',
  `name` varchar(20) NOT NULL DEFAULT '' COMMENT '权限名称',
  `method` varchar(10) NOT NULL DEFAULT '' COMMENT '权限请求方式',
  `type` tinyint(4) NOT NULL COMMENT '权限类型：1 前端路由；2 后端路由'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='权限表';

-- ----------------------------
-- Records of acl
-- ----------------------------
BEGIN;
INSERT INTO `acl` VALUES ('E2Pm-fR7M-mLFK-xaem', '', '登录', '', 1);
INSERT INTO `acl` VALUES ('3Fbd-iOO1-87iL-nnsL', '', '主界面', '', 1);
INSERT INTO `acl` VALUES ('jLkY-kHCP-T2vZ-Eh9A', '', '添加试题', '', 1);
INSERT INTO `acl` VALUES ('i1Gf-Ybiw-Svsu-BhLO', '', '试题分类', '', 1);
INSERT INTO `acl` VALUES ('yQ31-kGv6-nZcw-3ozA', '', '查看试题', '', 1);
INSERT INTO `acl` VALUES ('yRbb-SEGO-u4g8-ssbN', '', '添加用户', '', 1);
INSERT INTO `acl` VALUES ('GVfA-cHfZ-Oofj-xS9e', '', '用户展示', '', 1);
INSERT INTO `acl` VALUES ('72oq-30Pz-WAjJ-67Ze', '', '添加考试', '', 1);
INSERT INTO `acl` VALUES ('dcnG-cUOr-i5nQ-6rsf', '', '添加菜单', '', 1);
INSERT INTO `acl` VALUES ('o9du-aS6i-GhYA-9G1Q', '', '编辑试题', '', 1);
INSERT INTO `acl` VALUES ('ZQrZ-3jrX-U7cn-1Qe9', '', '试题详情', '', 1);
INSERT INTO `acl` VALUES ('uj7l-hSTP-fgk2-v3sT', '', '班级管理', '', 1);
INSERT INTO `acl` VALUES ('SakU-kHTU-5okE-xMnM', '', '学生管理', '', 1);
INSERT INTO `acl` VALUES ('XVb6-BgiW-vZFF-kTuF', '', '教室管理', '', 1);
INSERT INTO `acl` VALUES ('hxmq-Z0L6-wmgf-mcTm', '', '试卷列表', '', 1);
INSERT INTO `acl` VALUES ('L8tK-QNWC-79Fi-nmSQ', '', '创建试卷', '', 1);
INSERT INTO `acl` VALUES ('3lXq-RMNA-n7YP-coN7', '', '试卷详情', '', 1);
INSERT INTO `acl` VALUES ('U8G3-HXou-axUH-OCTN', '', '阅卷', '', 1);
INSERT INTO `acl` VALUES ('SZfQ-SBiv-z8dX-Wfzf', '', '批卷班级', '', 1);
INSERT INTO `acl` VALUES ('F4mg-dpoJ-IUHm-nJ3S', '', '待批试卷', '', 1);
COMMIT;

-- ----------------------------
-- Table structure for exam
-- ----------------------------
DROP TABLE IF EXISTS `exam`;
CREATE TABLE `exam` (
  `id` varchar(30) NOT NULL COMMENT '考试id',
  `title` varchar(255) NOT NULL COMMENT '考试标题',
  `desc` varchar(100) NOT NULL DEFAULT '' COMMENT '考试描述',
  `status` tinyint(4) NOT NULL DEFAULT '-1' COMMENT '-1 表示未确认，0 表示未开始，1 表示正在进行，2 表示已完成',
  `num` tinyint(4) NOT NULL COMMENT '试卷的题量',
  `start_time` varchar(16) NOT NULL COMMENT '考试开始时间',
  `end_time` varchar(16) NOT NULL COMMENT '考试结束时间',
  `qids` varchar(255) NOT NULL COMMENT '考题集合',
  `etid` varchar(30) NOT NULL COMMENT '考试类型id',
  `sid` varchar(30) NOT NULL COMMENT '学科id',
  `uid` varchar(30) NOT NULL COMMENT '出题人id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='考试表';

-- ----------------------------
-- Records of exam
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for exam_record
-- ----------------------------
DROP TABLE IF EXISTS `exam_record`;
CREATE TABLE `exam_record` (
  `id` varchar(30) NOT NULL COMMENT '考试记录id',
  `answer_path` varchar(255) NOT NULL COMMENT '学生答题文件路径',
  `score` tinyint(4) NOT NULL DEFAULT '0' COMMENT '考试得分',
  `start_time` varchar(16) NOT NULL COMMENT '考试开始时间',
  `end_time` varchar(16) NOT NULL COMMENT '考试结束时间',
  `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0 表示未阅，1 表示已阅',
  `sid` varchar(30) NOT NULL COMMENT '学生id',
  `gid` varchar(30) NOT NULL COMMENT '学生班级id',
  `eid` varchar(30) NOT NULL COMMENT '考试id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='考试记录表';

-- ----------------------------
-- Records of exam_record
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for exam_type
-- ----------------------------
DROP TABLE IF EXISTS `exam_type`;
CREATE TABLE `exam_type` (
  `id` varchar(30) NOT NULL COMMENT '考试类型id',
  `name` varchar(20) NOT NULL COMMENT '考试类型名称，比如：周考1、周考2、周考3、月考',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='考试类型';

-- ----------------------------
-- Records of exam_type
-- ----------------------------
BEGIN;
INSERT INTO `exam_type` VALUES ('8E5z-MKMW-VWFg-vJdh', '月考');
INSERT INTO `exam_type` VALUES ('CDY6-LXQE-SWJ5-Bb1j', '周考2');
INSERT INTO `exam_type` VALUES ('dW1T-gVoh-KqKt-2U1r', '周考1');
INSERT INTO `exam_type` VALUES ('it4k-lDu8-ngBH-c1WY', '周考3');
COMMIT;

-- ----------------------------
-- Table structure for grade
-- ----------------------------
DROP TABLE IF EXISTS `grade`;
CREATE TABLE `grade` (
  `id` varchar(30) NOT NULL COMMENT '年级id',
  `name` varchar(20) NOT NULL COMMENT '年级名称',
  `rid` varchar(30) NOT NULL COMMENT '教室id',
  `sid` varchar(30) NOT NULL COMMENT '学科id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='年级表';

-- ----------------------------
-- Records of grade
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for question
-- ----------------------------
DROP TABLE IF EXISTS `question`;
CREATE TABLE `question` (
  `id` varchar(30) NOT NULL COMMENT '考题id',
  `title` varchar(255) NOT NULL COMMENT '考题标题',
  `path` varchar(255) NOT NULL COMMENT '考题内容文件路径',
  `e_tid` varchar(30) NOT NULL COMMENT '考题类型id',
  `sid` varchar(30) NOT NULL COMMENT '课程id',
  `q_tid` varchar(30) NOT NULL COMMENT '试题类型id',
  `uid` varchar(30) NOT NULL COMMENT '出题人id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='考题表';

-- ----------------------------
-- Records of question
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for question_type
-- ----------------------------
DROP TABLE IF EXISTS `question_type`;
CREATE TABLE `question_type` (
  `id` varchar(30) NOT NULL COMMENT '问题类型id',
  `name` varchar(30) NOT NULL COMMENT '问题类型名称',
  `sort` varchar(30) NOT NULL DEFAULT '0' COMMENT '排序'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='问题类型字典值';

-- ----------------------------
-- Records of question_type
-- ----------------------------
BEGIN;
INSERT INTO `question_type` VALUES ('490H-kwPF-HknY-pSXV', '简答题', '1');
INSERT INTO `question_type` VALUES ('CEVo-ZcR7-ojfG-BvAJ', '代码阅读题', '2');
INSERT INTO `question_type` VALUES ('9dR8-FPeg-KGZy-d1vn', '代码补全', '3');
INSERT INTO `question_type` VALUES ('VgSy-YqLk-XsQI-rxtU', '修改bug', '4');
INSERT INTO `question_type` VALUES ('kQMP-9FIg-YDXG-5dzI', '手写代码', '5');
COMMIT;

-- ----------------------------
-- Table structure for r_role_acl
-- ----------------------------
DROP TABLE IF EXISTS `r_role_acl`;
CREATE TABLE `r_role_acl` (
  `rid` varchar(30) NOT NULL COMMENT '角色id',
  `aid` varchar(30) NOT NULL COMMENT '权限id',
  UNIQUE KEY `rid` (`rid`,`aid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色权限关系表';

-- ----------------------------
-- Records of r_role_acl
-- ----------------------------
BEGIN;
INSERT INTO `r_role_acl` VALUES ('2ogg-lycg-BUv6-AjN1', '3Fbd-iOO1-87iL-nnsL');
INSERT INTO `r_role_acl` VALUES ('2ogg-lycg-BUv6-AjN1', '3lXq-RMNA-n7YP-coN7');
INSERT INTO `r_role_acl` VALUES ('2ogg-lycg-BUv6-AjN1', '72oq-30Pz-WAjJ-67Ze');
INSERT INTO `r_role_acl` VALUES ('2ogg-lycg-BUv6-AjN1', 'E2Pm-fR7M-mLFK-xaem');
INSERT INTO `r_role_acl` VALUES ('2ogg-lycg-BUv6-AjN1', 'hxmq-Z0L6-wmgf-mcTm');
INSERT INTO `r_role_acl` VALUES ('2ogg-lycg-BUv6-AjN1', 'i1Gf-Ybiw-Svsu-BhLO');
INSERT INTO `r_role_acl` VALUES ('2ogg-lycg-BUv6-AjN1', 'jLkY-kHCP-T2vZ-Eh9A');
INSERT INTO `r_role_acl` VALUES ('2ogg-lycg-BUv6-AjN1', 'L8tK-QNWC-79Fi-nmSQ');
INSERT INTO `r_role_acl` VALUES ('2ogg-lycg-BUv6-AjN1', 'o9du-aS6i-GhYA-9G1Q');
INSERT INTO `r_role_acl` VALUES ('2ogg-lycg-BUv6-AjN1', 'yQ31-kGv6-nZcw-3ozA');
INSERT INTO `r_role_acl` VALUES ('2ogg-lycg-BUv6-AjN1', 'ZQrZ-3jrX-U7cn-1Qe9');
INSERT INTO `r_role_acl` VALUES ('DgLx-lE67-GrAd-jmpO', '3Fbd-iOO1-87iL-nnsL');
INSERT INTO `r_role_acl` VALUES ('DgLx-lE67-GrAd-jmpO', '3lXq-RMNA-n7YP-coN7');
INSERT INTO `r_role_acl` VALUES ('DgLx-lE67-GrAd-jmpO', 'E2Pm-fR7M-mLFK-xaem');
INSERT INTO `r_role_acl` VALUES ('DgLx-lE67-GrAd-jmpO', 'F4mg-dpoJ-IUHm-nJ3S');
INSERT INTO `r_role_acl` VALUES ('DgLx-lE67-GrAd-jmpO', 'yQ31-kGv6-nZcw-3ozA');
INSERT INTO `r_role_acl` VALUES ('DgLx-lE67-GrAd-jmpO', 'ZQrZ-3jrX-U7cn-1Qe9');
INSERT INTO `r_role_acl` VALUES ('XQVn-TEEs-yhQd-qxhG', '3Fbd-iOO1-87iL-nnsL');
INSERT INTO `r_role_acl` VALUES ('XQVn-TEEs-yhQd-qxhG', '3lXq-RMNA-n7YP-coN7');
INSERT INTO `r_role_acl` VALUES ('XQVn-TEEs-yhQd-qxhG', '72oq-30Pz-WAjJ-67Ze');
INSERT INTO `r_role_acl` VALUES ('XQVn-TEEs-yhQd-qxhG', 'dcnG-cUOr-i5nQ-6rsf');
INSERT INTO `r_role_acl` VALUES ('XQVn-TEEs-yhQd-qxhG', 'E2Pm-fR7M-mLFK-xaem');
INSERT INTO `r_role_acl` VALUES ('XQVn-TEEs-yhQd-qxhG', 'F4mg-dpoJ-IUHm-nJ3S');
INSERT INTO `r_role_acl` VALUES ('XQVn-TEEs-yhQd-qxhG', 'GVfA-cHfZ-Oofj-xS9e');
INSERT INTO `r_role_acl` VALUES ('XQVn-TEEs-yhQd-qxhG', 'hxmq-Z0L6-wmgf-mcTm');
INSERT INTO `r_role_acl` VALUES ('XQVn-TEEs-yhQd-qxhG', 'i1Gf-Ybiw-Svsu-BhLO');
INSERT INTO `r_role_acl` VALUES ('XQVn-TEEs-yhQd-qxhG', 'jLkY-kHCP-T2vZ-Eh9A');
INSERT INTO `r_role_acl` VALUES ('XQVn-TEEs-yhQd-qxhG', 'L8tK-QNWC-79Fi-nmSQ');
INSERT INTO `r_role_acl` VALUES ('XQVn-TEEs-yhQd-qxhG', 'o9du-aS6i-GhYA-9G1Q');
INSERT INTO `r_role_acl` VALUES ('XQVn-TEEs-yhQd-qxhG', 'SakU-kHTU-5okE-xMnM');
INSERT INTO `r_role_acl` VALUES ('XQVn-TEEs-yhQd-qxhG', 'SZfQ-SBiv-z8dX-Wfzf');
INSERT INTO `r_role_acl` VALUES ('XQVn-TEEs-yhQd-qxhG', 'U8G3-HXou-axUH-OCTN');
INSERT INTO `r_role_acl` VALUES ('XQVn-TEEs-yhQd-qxhG', 'uj7l-hSTP-fgk2-v3sT');
INSERT INTO `r_role_acl` VALUES ('XQVn-TEEs-yhQd-qxhG', 'XVb6-BgiW-vZFF-kTuF');
INSERT INTO `r_role_acl` VALUES ('XQVn-TEEs-yhQd-qxhG', 'yQ31-kGv6-nZcw-3ozA');
INSERT INTO `r_role_acl` VALUES ('XQVn-TEEs-yhQd-qxhG', 'yRbb-SEGO-u4g8-ssbN');
INSERT INTO `r_role_acl` VALUES ('XQVn-TEEs-yhQd-qxhG', 'ZQrZ-3jrX-U7cn-1Qe9');
COMMIT;

-- ----------------------------
-- Table structure for r_user_role
-- ----------------------------
DROP TABLE IF EXISTS `r_user_role`;
CREATE TABLE `r_user_role` (
  `uid` varchar(30) NOT NULL COMMENT '用户id',
  `rid` varchar(30) NOT NULL COMMENT '角色id',
  UNIQUE KEY `uid` (`uid`,`rid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户角色关系表';

-- ----------------------------
-- Records of r_user_role
-- ----------------------------
BEGIN;
INSERT INTO `r_user_role` VALUES ('4l7T-Ldxb-1cSV-2mda', '2BrW-hEIK-fyb3-oqGF');
INSERT INTO `r_user_role` VALUES ('Cg3l-8piO-2gpE-TlgW', 'XQVn-TEEs-yhQd-qxhG');
INSERT INTO `r_user_role` VALUES ('gs2q-XLrR-kkuU-d0uM', 'DgLx-lE67-GrAd-jmpO');
INSERT INTO `r_user_role` VALUES ('MR69-wk1h-iuyM-fKkl', '2ogg-lycg-BUv6-AjN1');
INSERT INTO `r_user_role` VALUES ('rcHH-FJ82-GhnL-Er2O', 'DgLx-lE67-GrAd-jmpO');
INSERT INTO `r_user_role` VALUES ('UHQQ-Y7eR-Ks8p-PC09', 'XQVn-TEEs-yhQd-qxhG');
INSERT INTO `r_user_role` VALUES ('wy2a-ymM6-1PiH-NhgF', 'XQVn-TEEs-yhQd-qxhG');
COMMIT;

-- ----------------------------
-- Table structure for role
-- ----------------------------
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role` (
  `id` varchar(30) NOT NULL COMMENT '角色id',
  `name` varchar(20) NOT NULL COMMENT '角色名称',
  `sort` tinyint(4) NOT NULL DEFAULT '1' COMMENT '排序，优先级',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色表';

-- ----------------------------
-- Records of role
-- ----------------------------
BEGIN;
INSERT INTO `role` VALUES ('2ogg-lycg-BUv6-AjN1', '出题者', 2);
INSERT INTO `role` VALUES ('DgLx-lE67-GrAd-jmpO', '浏览者', 3);
INSERT INTO `role` VALUES ('XQVn-TEEs-yhQd-qxhG', '管理员', 1);
COMMIT;

-- ----------------------------
-- Table structure for room
-- ----------------------------
DROP TABLE IF EXISTS `room`;
CREATE TABLE `room` (
  `id` varchar(30) NOT NULL COMMENT '教室id',
  `name` varchar(60) NOT NULL COMMENT '教室名称',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='教室表';

-- ----------------------------
-- Records of room
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for student
-- ----------------------------
DROP TABLE IF EXISTS `student`;
CREATE TABLE `student` (
  `id` varchar(30) NOT NULL COMMENT '学生id',
  `realname` varchar(20) NOT NULL COMMENT '学生姓名',
  `code` varchar(30) NOT NULL COMMENT '学号',
  `password` varchar(60) NOT NULL COMMENT '学生密码',
  `gid` varchar(30) NOT NULL COMMENT '年级id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='学生表';

-- ----------------------------
-- Records of student
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for subject
-- ----------------------------
DROP TABLE IF EXISTS `subject`;
CREATE TABLE `subject` (
  `id` varchar(30) NOT NULL COMMENT '学科id',
  `name` varchar(30) NOT NULL COMMENT '学科名称',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='学科表';

-- ----------------------------
-- Records of subject
-- ----------------------------
BEGIN;
INSERT INTO `subject` VALUES ('3oQT-ua6H-Al1j-Iy0X', 'node基础');
INSERT INTO `subject` VALUES ('aUsx-5Tpm-JGHv-LqVb', '组件化开发(vue)');
INSERT INTO `subject` VALUES ('E2MB-JCe0-uCSN-DP3S', 'javaScript下');
INSERT INTO `subject` VALUES ('hr00-dHZM-BxKw-C2y5', 'javaScript上');
INSERT INTO `subject` VALUES ('lDKe-V4e4-B2TH-3Dns', '移动端开发');
INSERT INTO `subject` VALUES ('OnUS-IbXo-5mxd-5yFu', '渐进式开发(react)');
INSERT INTO `subject` VALUES ('qdlf-5pYI-hRaP-OlzI', '项目实战');
INSERT INTO `subject` VALUES ('SBt6-TPST-4owz-IX2Y', 'javaScript高级');
INSERT INTO `subject` VALUES ('xACq-jNuK-SwTK-Rhed', '模块化开发');
INSERT INTO `subject` VALUES ('ZO4x-If9D-rNEg-fIMS', 'node高级');
COMMIT;

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` varchar(30) NOT NULL COMMENT '用户id',
  `username` varchar(20) NOT NULL COMMENT '用户名',
  `password` varchar(64) NOT NULL COMMENT '密码',
  `nickname` varchar(20) NOT NULL COMMENT '用户昵称',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户表';

-- ----------------------------
-- Records of user
-- ----------------------------
BEGIN;
INSERT INTO `user` VALUES ('gs2q-XLrR-kkuU-d0uM', 'preview', '87867e3d1fb063ced929b592c54ebe8331fd679395afb5c4b818ca3c2cdc0189', '浏览者');
INSERT INTO `user` VALUES ('MR69-wk1h-iuyM-fKkl', 'worker', '87867e3d1fb063ced929b592c54ebe8331fd679395afb5c4b818ca3c2cdc0189', '出题者');
INSERT INTO `user` VALUES ('wy2a-ymM6-1PiH-NhgF', 'admin', '87867e3d1fb063ced929b592c54ebe8331fd679395afb5c4b818ca3c2cdc0189', '管理员');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
